<?php

namespace common\entities\outstock;

use common\entities\ContractEntity;
use Yii;

/**
 * This is the model class for table "myscrm_out_stock_product".
 *
 * @property string $id
 * @property string $order_id
 * @property string $application_id
 * @property string $application_name
 * @property integer $rent_period
 * @property integer $total_num
 * @property integer $apply_num
 * @property integer $contract_type
 * @property string $bind_project
 * @property string $remarks
 * @property string $created_on
 * @property string $created_by
 * @property string $contract_application_id
 * @property integer $is_qd_advanced
 */
class MyscrmOutStockProductEntity extends ContractEntity
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'myscrm_out_stock_product';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id', 'order_id', 'application_id'], 'required'],
            [['rent_period', 'total_num', 'apply_num', 'contract_type', 'is_qd_advanced'], 'integer'],
            [['bind_project'], 'string'],
            [['created_on'], 'safe'],
            [['id', 'order_id', 'application_id', 'created_by', 'contract_application_id'], 'string', 'max' => 36],
            [['application_name'], 'string', 'max' => 45],
            [['remarks'], 'string', 'max' => 1024]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'order_id' => '出库单据ID',
            'application_id' => '应用ID',
            'application_name' => '应用名称',
            'rent_period' => '租用周期（月）',
            'total_num' => '总数量',
            'apply_num' => '申请数量',
            'contract_type' => '合同类型：1新增 2增购 3续签',
            'bind_project' => '绑定的项目ID',
            'remarks' => '备注',
            'created_on' => '创建时间',
            'created_by' => '创建人',
            'is_qd_advanced' => '是否渠道管家旗舰版',
            'contract_application_id' => '合同产品id',
        ];
    }
}
